<?php
include_once "inc/config.php";
include_once "inc/config_db.php";
include_once "inc/linb.php";
include_once "inc/template.php";

define('IN' , true);
$tpl_refresh_time = $skincache;	
$tpl_default_dir =  dirname(__FILE__)."/templates/".$skindir."";
$t = new template;
$t->tpl_default_dir = $tpl_default_dir;
$t->tpl_refresh_time = $tpl_refresh_time;

$id=verify_id($_GET['id']);
$strSql="SELECT * FROM tun2_content WHERE id =$id";
$db->query($strSql);
	if($db->next_record())
		{
			$title  	= $db->Record["title"];
			$id		    = $db->Record["id"];
			$module     = namezh("tun2_columns","module",$db->Record["columnsname"]);
			$templates  = namezh("tun2_columns","templates",$db->Record["columnsname"]);
			$keywords   = namezh("tun2_columns","keywords",$db->Record["columnsname"]);
			$description= namezh("tun2_columns","description",$db->Record["columnsname"]);
			$columnsname= namezh("tun2_columns","columnsname",$db->Record["columnsname"]);
			$columnsid 	= $db->Record["columnsname"];
			$columnsurl = classlink($db->Record["columnsname"]);
			$actor 	    = actorlink($db->Record["actor"]);
			$photo		= tun2pic($db->Record["photo"]);
			$content 	= $db->Record["content"];
			$date 		= substr($db->Record["addtime"],0,10);
			$htmldate 	= date("Ymdgis",strtotime($db->Record["addtime"]));
			$size       = module("products","size",$db->Record["id"]);
			$price      = module("products","price",$db->Record["id"]);
			$experience = module("hr","experience",$db->Record["id"]);
			$nature     = module("hr","nature",$db->Record["id"]);
			$education  = module("hr","education",$db->Record["id"]);
			$amount     = module("hr","amount",$db->Record["id"]);
			$pay        = module("hr","pay",$db->Record["id"]);
			$downloadtitle = module("download","title",$db->Record["id"]);
			$downloadurl   = module("download","url",$db->Record["id"]);
			$hits 	="<span id=\"tun2hits\">正在读取</span>";
			$hits .="<script type=\"text/javascript\" src=\"".$webdir."inc/ajaxrequest.js\"></script>";
			$hits .="<script language=\"javascript\" type=\"text/javascript\">";
			$hits .="var ajax=new AJAXRequest({\n";
			$hits .="url: \"".$webdir."inc/showhits.php?id=".$id."\",";
			$hits .="method: \"GET\",";
			$hits .="oncomplete: showhits,";
			$hits .="charset: \"utf-8\"";
			$hits .="});";
			$hits .="ajax.get();";
			$hits.="function showhits(obj)";
			$hits.="{";
			$hits.="document.getElementById(\"tun2hits\").innerHTML=obj.responseText;";
			$hits.="}";
			$hits.="</script>";
		}else{
		echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
<script language=javascript>alert(\"对不起！没有您要找的信息或是该信息已经删除！\");window.location='".$webdir."index.php'</script>";
		exit();
		}
if($templates=="")
{
if ($module==1)
{
$tid="view_single";
}
if ($module==2)
{
$tid="view_article";
}
if ($module==3)
{
$tid="view_product";
}
if ($module==4)
{
$tid="view_hr";
}
if ($module==5)
{
$tid="view_download";
}
}
else
{
	$tid="view_".$templates."";
}
$location=Location('view',$columnsid); 
include $t->tpl($tid);
echo "\n<script language=\"javascript\" type=\"text/javascript\" src=\"".$webdir."inc/hits.php?id=".$id."\"></script>\n";
?>